#include <stdio.h>
#include <string.h>

#define MAX 10

int main(int argc, char *argv[])
{
	int n, a[MAX], min, min2;
	int i, j, t;
	char buf[128], *ps;

	gets(buf); n = atoi(buf);
	gets(buf);
	for (ps=strtok(buf, " "), i=0; ps; ps=strtok(NULL, " "), i++) {
		a[i] = atoi(ps);
	}

	for (i=0; i<n-1; i++) {
		for (j=i+1; j<n; j++) {
			if (a[i] > a[j]) {
				t = a[i]; a[i] = a[j]; a[j] = t;
			}
		}
	}

	printf("%d\n", a[1]);

	return 0;
}
